ankey('../res/ankey.json', 1)


function ankey(path, params) {
    //$ajax()获取文件
    $.ajax({
        url: path,
        dataType: 'json',
        params: params
    }).then(function (ankeyData) {
        const data = ankeyData
        drawAnkey(data.data)
    })
}
function drawAnkey(datas) {
    var mytext = echarts.init(document.getElementById('ankey'));
    option = {
        title: {
            text: '卡口-车辆类型',
            textStyle:{
                color:'	#FFFFFF',
                fontSize:'15'
              }
        },
        series: {
            type: 'sankey',
            layout: 'none',
            emphasis: {
                focus: 'adjacency'
            },
            data:
                datas.data,

            links:
                datas.links

        }
    };

    option && mytext.setOption(option);
}
